Release 10.1A: OpenEdge Development:
Programming Interfaces
Data-handling statements
Statements that move data from one location to another are called data-handling statements.
Progress stores data in various locations—a database, a record buffer, a screen buffer, etc. A database stores application data on disk. A record buffer stores data temporarily while a procedure accesses the data, and stores the values of variables used in the procedure. A screen buffer stores data being displayed on the screen or being sent to another output destination; it also stores data that is being entered from the terminal or other input source.
Figure 1–1 shows how the data-handling statements move data.
Figure 1–1: Data movement
![]()
To use Figure 1–1, read each statement from top to bottom. The beginning of the first arrow (the dot) indicates the source of the data. The arrowhead of the last arrow indicates where the data is finally stored. For example, the
DISPLAYstatement gets data from a record buffer and moves it into a screen buffer. Once in the screen buffer, the data is displayed on screen. Also, note thatINSERTcreates a new database record, moves it to the record buffer, and then to the screen buffer where the user enters data, which is then moved back to the record buffer.Some statements are made up of other statements. For example, the
UPDATEstatement is made up of theDISPLAY,PROMPT–FOR, andASSIGNstatements, and performs the same steps as these other statements. First, it copies data from the record buffer to the screen buffer (DISPLAY). Second, it allows data to be entered into the screen buffer (PROMPT–FOR). Third, it copies the data back to the record buffer (ASSIGN).You can use statements as building blocks, using only as many as you need to do specific tasks. For example, the
INSERTstatement is very powerful and combines several processing steps into one statement. But in some situations, it is less flexible than using theCREATE,DISPLAY, andSETstatements individually (or theCREATEandUPDATEstatements).Figure 1–2 shows the primary data-handling statements and shows which statements are composed of other statements.
Figure 1–2: The primary data-handling statements
![]()
Note that the
UPDATE,SET, andASSIGNstatements do not actually write records to the database. However, at the end of a transaction (or at the end of the record scope or after an explicitRELEASE), Progress writes all modified records to the database.If you modify a record using
INSERT,UPDATE, orSET, Progress assigns the change to the record buffer (and, hence, eventually to the database). However, if you use theENABLEstatement, you must explicitly assign any changes with theASSIGNstatement.For more information on the statements in Figure 1–2, see the OpenEdge Development: Progress 4GL Reference .
|
Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |